package ro.unibuc.hobbygroups.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Required;
import ro.unibuc.hobbygroups.dao.GenericDAO;
import ro.unibuc.hobbygroups.domain.Group;

public class GroupsServiceImpl implements GroupsService {

    private GenericDAO groupsDao;

    public Group findGroup(Long id) {
        return (Group) groupsDao.find(id);
    }

    public List<Group> findAll() {
        return groupsDao.findAll();
    }

    public void create(Group group) {
        groupsDao.create(group);
    }

    @Required
    public void setGroupsDao(GenericDAO groupsDao) {
        this.groupsDao = groupsDao;
    }
}